<%@ page import="com.sunelec.pojo.Users" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>用户关联</title>
    <meta name="renderer" content="webkit" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="${pageContext.request.contextPath}/static/css/font-awesome.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/style.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/associate.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/page.css" rel="stylesheet" />
</head>
<body>
<div class="top">
    <div class="top-left">
        <div class="kong"></div>
        <div class="logo">
            <img src="${pageContext.request.contextPath}/static/imgs/logo3.png">
        </div>
    </div>
    <div class="top-right">
        <ul class="list">
            <li><a href="${pageContext.request.contextPath}/powerCenter.action?username=${username}">电站中心</a></li>
            <li><a href="checkCenter.jsp">运维中心</a></li>
            <li><a href="${pageContext.request.contextPath}/InReportCenter">报表中心</a></li>
            <li><a href="${pageContext.request.contextPath}/centralizedControl">展示中心</a></li>
            <% if(session.getAttribute("users")!=null){
                Users users = (Users)session.getAttribute("users");
            %>
            <% if(users.getType()==1){%>
            <li><a href="${pageContext.request.contextPath}/InidManage">账号管理</a></li>
            <% }%>
            <% } %>
            <li><a href="${pageContext.request.contextPath}/checkOut.action" ><span class="fa fa-user"></span></a></li>
        </ul>
    </div>
</div>
<div class="main" id="app">
    <form class="center" action='AssociatedUser' method='post' id="myForm">
        <div class="left">
            <div class="title">
                <span>二级账号</span>
            </div>
            <div class="content">
                <table id="list-wrap" class="table">

                </table>
                <div class="ui-page page" id="ui-page">

                </div>
            </div>
        </div>
        <div class="guanlian">
            <div class="confirm">
                <div class="icon">
                    <span class="fa fa-random"></span>
                </div>
                <div>
                    <input value="提交" type="button" onclick="getValue()" >
                </div>
                <div>
                    <input type="reset" value="取消" >
                </div>
            </div>
            <div class="kong2 text-center">
                ${state}
            </div>
            <input type="text" name="leveluser2" id="leveluser2" class="hidden" value="">
            <input type="text" name="leveluser3" id="leveluser3" class="hidden" value="">
        </div>
        <div class="right">
            <div class="title">
                <span>三级账号</span>
            </div>
            <div class="content">
                <table class="table" id="list-wrap2">

                </table>
                <div id="ui-page2" class="ui-page2 page2">

                </div>
            </div>
        </div>
    </form>
</div>
<script src="${pageContext.request.contextPath}/static/js/jquery.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
<script>
    data = ${result};
</script>
<script src="${pageContext.request.contextPath}/static/js/sendAjax.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/js/page.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/js/page2.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/js/associate.js" type="text/javascript"></script>

<script>

    /* 初始化页面 */
    if(${pageNum1 == 1}) {
        initTotalPageNum=2;
        pageSize=1;
        $("#ui-page").paging({pageSize:pageSize,totalPage:initTotalPageNum});
        document.getElementsByClassName('page')[1].click();
        document.getElementById('next').style.display='none';
        document.getElementById('end').style.display='none';
    } else {
        initTotalPageNum=${pageNum1};
        pageSize=3;
        $("#ui-page").paging({pageSize:pageSize,totalPage:initTotalPageNum});
        document.getElementsByClassName('page')[1].click();
    }

    if(${pageNum2 == 1}) {
        initTotalPageNum2=2;
        pageSize2=1;
        $("#ui-page2").paging2({pageSize2:pageSize2,totalPage2:initTotalPageNum2});
        document.getElementsByClassName('page2')[1].click();
        document.getElementById('next2').style.display='none';
        document.getElementById('end2').style.display='none';
    } else {
        initTotalPageNum2=${pageNum2};
        pageSize2=3;
        $("#ui-page2").paging2({pageSize2:pageSize2,totalPage2:initTotalPageNum2});
        document.getElementsByClassName('page2')[1].click();
    }

</script>
</body>
</html>